<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="template.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:define name="body">
	<f:metadata>
		<f:event type="preRenderView" listener="#{guvenlikDenetimi.erisimKontrol()}"></f:event>
	</f:metadata>
	
	<center>
	<h:form prependId="false">
		<p:panel id="panel" header="Yeni Kullanıcı"
			style="margin-top:15%; width:35%">
			<p:messages />
			<h:panelGrid columns="3">
				<h:outputLabel value="Ad: *" />
				<p:inputText id="ad" value="#{kullaniciAction.ad}" required="true">
					<f:validateLength minimum="2" />
				</p:inputText>
				<p:message for="ad" />

				<h:outputLabel value="Soyad: *" />
				<p:inputText id="soyad" value="#{kullaniciAction.soyad}" required="true" />
				<p:message for="soyad" />
				
				<h:outputLabel value="Yaş: *" />
				<p:inputText id="yas" value="#{kullaniciAction.yas}" required="true" >
					<f:validateLongRange minimum = "0" maximum = "100"/>
				</p:inputText>
				<p:message for="yas" />
				
				<h:outputLabel value="Ülke: *" />
				<p:inputText id="ulke" value="#{kullaniciAction.ulke}" required="true" />
				<p:message for="ulke" />
				
			</h:panelGrid>
		</p:panel>

		<p:commandButton value="Kaydet" update="panel,display"  
             actionListener="#{kullaniciAction.kaydet}" />
               
		<p:commandButton value="Temizle" type="reset" />
		  
		<!--  <p:panel id="display" header="Yeni Kullanıcı Bilgileri" style="margin-top:10px; width:35%">
			<h:panelGrid columns="2">
				<h:outputText value="Ad: " />
				<h:outputText value="#{kullaniciAction.ad}" />

				<h:outputText value="Soyad: " />
				<h:outputText value="#{kullaniciAction.soyad}" />
			</h:panelGrid>
		</p:panel>
		-->
	</h:form>
	</center>
</ui:define>
</ui:composition>